//목록리스트 2단계 메인,서브 어댑터
package kr.jin.zeroprojectone;

import java.util.ArrayList;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class DBListAdapterStep2 extends BaseAdapter {
	Context mainContext;
	LayoutInflater Inflater;
	ArrayList<MyItemsDBList2> arSrc;
	int layout;
	

	public DBListAdapterStep2(Context mainContext, int layout, ArrayList<MyItemsDBList2> arSrc) {
		super();
		this.mainContext = mainContext;
		this.Inflater = (LayoutInflater)mainContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		this.arSrc = arSrc;
		this.layout = layout;
	}

	@Override
	public int getCount() {
		return arSrc.size();
	}

	@Override
	public String getItem(int position) {
		return arSrc.get(position).date2;
	}
	
	public String getItem2(int position) {
		return arSrc.get(position).activity2;
	}
	
	public String getItem3(int position) {
		return arSrc.get(position).time2;
	}
	
	public Integer getItem0(int position) {
		return arSrc.get(position).id2;
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		
		if(convertView == null){
			convertView = Inflater.inflate(layout,parent,false);
		}

		/*TextView dbListStep0 = (TextView) convertView.findViewById(R.id.dblistviewstep2_0);
		dbListStep0.setText(String.format("%d", arSrc.get(position).id2));*/
		
		TextView dbListStep1 = (TextView) convertView.findViewById(R.id.dblistviewstep2_1);
		dbListStep1.setText(arSrc.get(position).date2);
		
		TextView dbListStep2 = (TextView) convertView.findViewById(R.id.dblistviewstep2_2);
		dbListStep2.setText(arSrc.get(position).activity2);
		
		TextView dbListStep3 = (TextView) convertView.findViewById(R.id.dblistviewstep2_3);
		dbListStep3.setText(arSrc.get(position).time2);
		
		return convertView;
	}

}